/**
 * @File name: basic_info.c
 * @Synopsis:
 * @Author: xing.dai@aliyun.com
 * @Version: 0.0.1
 * @Date: 2018-08-13 11:07
 */

#include "debug_print.h"

static int show_git_commit_sha1(void)
{
    show_info("GIT SHA1:	%s\n", GIT_COMMIT_SHA1);
    return 0;
}

static int show_compiler(void)
{
#ifdef __GNUC__
    show_info("Compiler:	[%s] %s\n", COMPILER, __VERSION__);
#endif
#ifdef __ARMCC_VERSION
    show_info("Compiler:	[%s] V%d.%02d(build %04d)\n", "ARMCC", __ARMCC_VERSION / 1000000, __ARMCC_VERSION % 1000000 / 10000, __ARMCC_VERSION % 10000);
#endif
    return 0;
}

static int show_compile_time(void)
{
    show_info("Build Time:	%s %s\n", __DATE__, __TIME__);
    return 0;
}

static int show_project_name(void)
{
    show_info("Project:	%s\n", PROJECT);
    return 0;
}

int show_basic_info(void)
{
    show_info("================================================================================\n");
    show_project_name();
    show_compiler();
    show_git_commit_sha1();
    show_compile_time();
    show_info("================================================================================\n");
    return 0;
}
